package com.design.strategy;


/**
 * Created by yijy on 2017/12/5.
 */
public class LinkedList implements Collection{

    private Node head;

    private Node tail;

    int count=0;

    public void add(Object o){
        Node n = new Node(o,null);
        if(head==null){
            head = n;
            tail = n;
        }
        tail.setData(o);
        tail = n;
        count++;
    }

    @Override
    public int size(){
        return count;
    }

    @Override
    public Iterator itertor() {
        return null;
    }

}
